home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / word.arj / WEIRD.C < prev    next >
C/C++ Source or Header  |  1993-01-28  |  1KB  |  61 lines

  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <wgt.h>
  4.  
  5. // WEIRD! Try moving the mouse around and watch the 'snakes' follow it!
  6.  
  7. int x,y,i,j;
  8. int px[256],py[256];
  9. color p[256];
  10. int numpix;
  11.  
  12. void main(void)
  13. {
  14. numpix=155;
  15. vga256();
  16. wloadpalette("wgt1.pal",&p);
  17. wsetpalette(0,255,&p);
  18. i=minit();
  19. for (i=0; i<256; i++)
  20.   {
  21.   px[i]=0;
  22.   py[i]=0;
  23.   }
  24.  
  25.  
  26. do {
  27. mread();
  28. wsetcolor(0);
  29. for (i=numpix; i>=1; i--)
  30.  {
  31.  wfastputpixel(px[i],py[i]);
  32.  wfastputpixel(319-px[i],199-py[i]);
  33. // wfastputpixel(319-px[i],py[i]);
  34. // wfastputpixel(px[i],199-py[i]);
  35.  px[i]=px[i-1];
  36.  py[i]=py[i-1];
  37. }
  38.  wsetcolor(0);
  39.  wfastputpixel(px[0],py[0]);
  40.  wfastputpixel(319-px[0],199-py[0]);
  41. // wfastputpixel(319-px[0],py[0]);
  42. // wfastputpixel(px[0],199-py[0]);
  43.  
  44. px[0]=mx;
  45. py[0]=my;
  46.  
  47. for (i=0; i<numpix; i++)
  48.  {
  49.  wsetcolor(i);
  50.  wfastputpixel(px[i],py[i]);
  51.  wfastputpixel(319-px[i],199-py[i]);
  52. // wfastputpixel(319-px[i],py[i]);
  53. // wfastputpixel(px[i],199-py[i]);
  54.  
  55. }
  56.  
  57. } while (but !=2);
  58. textmode(C80);
  59. }
  60.  
  61.